package com.zeen.wima.common;

import java.io.File;

import android.content.Context;
import android.os.Environment;

public class Workspace {

	public Workspace(Context context) {
		init(context);
	}

	/**
	 * @author: Jacky
	 * @date: 2010-09-27
	 * @brief:
	 */
	private void init(Context context) {
		File home = new File(Environment.getExternalStorageDirectory(),
				"/.wima");
		if (!home.exists()) {
			home.mkdir();
		}
		File download = new File(Environment.getExternalStorageDirectory(),
				"/.wima/download");
		if (!download.exists()) {
			download.mkdir();
		}
	}

	/**
	 * @author: Jacky
	 * @date: 2010-09-27
	 * @brief:
	 */
	public static String getDownloadDir() {
		File home = new File(Environment.getExternalStorageDirectory(),
				"/.wima");
		if (!home.exists()) {
			home.mkdir();
		}
		File download = new File(Environment.getExternalStorageDirectory(),
				"/.wima/download");
		if (!download.exists()) {
			download.mkdir();
		}
		return download.getAbsolutePath();
	}
}
